package com.lifeCicle.validators;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

public class Notebookvalidator implements Validator {
    public Notebookvalidator() {
        super();
    }

    public void validate(FacesContext facesContext, UIComponent uIComponent,
                         Object object) throws ValidatorException {
        FacesMessage facesMessage = new  FacesMessage();
        facesMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
        facesMessage.setDetail("details : notebook invalido");
        facesMessage.setSummary("Error Noteboo Validator");
        facesContext.getCurrentInstance().addMessage("f1:notebook",facesMessage);
    }
}
